<template>
  <div class="index">
    <swiper :options="swiperOption">
      <swiper-slide><img src="@/assets/img/startPage1.jpg" alt=""></swiper-slide>
      <swiper-slide><img src="@/assets/img/startPage2.jpg" alt=""></swiper-slide>
      <swiper-slide class="pr"><img src="@/assets/img/startPage3.jpg" alt=""><span @click="gohome" class="pa gohome">立即进入</span></swiper-slide>
      <!-- 分页器 -->
      <div class="swiper-pagination"  slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>
  import { mapMutations } from 'vuex'
  export default {
    data() {
      return {
        swiperOption: {
          pagination: {
            el: '.swiper-pagination',
          },
          effect : 'cube',
          cubeEffect: {
            slideShadows: true,
            shadow: true,
            shadowOffset: 100,
            shadowScale: 0.6
          },
        }
      }
    },
    methods:{
      gohome(){
        this.changeShow();
        this.$router.push('/home');
      },
      ...mapMutations(['changeShow']),
    }
  }
</script>

<style scoped lang="stylus">
  .index>>>.swiper-container-horizontal > .swiper-pagination-bullets .swiper-pagination-bullet {
    background: #fe5551;
    opacity: 1;
  }
  .index>>>.swiper-container-horizontal > .swiper-pagination-bullets .swiper-pagination-bullet-active {
    opacity: 1;
    background: #3b0808;
  }
  .index
    height: 100%
    width: 100%
    .gohome
      bottom 5%
      left: 50%
      color: #ffffff
      -webkit-border-radius: .2rem
      -moz-border-radius: .2rem
      border-radius: .2rem
      -webkit-transform: translateX(-50%)
      -moz-transform: translateX(-50%)
      -ms-transform: translateX(-50%)
      -o-transform: translateX(-50%)
      transform: translateX(-50%)
      padding: .3rem .8rem
      background: rgba(255,0,0,.8)
    img
      height: 100%
      width: 100%
      vertical-align top
</style>
